export function createTree(dataList,id) {
    let cloneData = JSON.parse(JSON.stringify(dataList)) // 对源数据深度克隆
    return cloneData.filter(father => {
        // 循环所有项，并添加children属性
        let branchArr = cloneData.filter(
            child => father[id] == child.parentId
        ) // 返回每一项的子级数组
        branchArr.length > 0 ? (father.children = branchArr) : '' //给父级添加一个children属性，并赋值
        return father.parentId == 0 //返回第一层
    })
}